package com.tcd.utils;

import java.lang.reflect.Field;

/**
 * @ClassName : com.tcd.utils.AccountUtils
 * @Description : 描述
 * Author : space
 * CreatedDate 2021-05-26 14:54:14
 */
public class AccountUtils {

    public static boolean isNull(String str) {
        return (str == null || str.equals("null") || str.trim().length() == 0);
    }

    public static boolean isAllNull(Object... objs){
        for (Object obj : objs) {
            if (obj != null){
                return false;
            }
        }
        return true;
    }

    public static Object getFieldVal(Object obj,String field) {
        Class cls = obj.getClass();
        try {
            Field fie = cls.getDeclaredField(field);
            fie.setAccessible(true);
            return fie.get(obj);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
